package sjtu.ist.warehouse4ws.service.cust;

import java.util.List;

import sjtu.ist.warehouse4ws.dao.ColumnDaoHibernate;
import sjtu.ist.warehouse4ws.dao.cust.CustColumnDaoHibernate;
import sjtu.ist.warehouse4ws.model.Column;
import sjtu.ist.warehouse4ws.model.CustColumn;

public class CustColumnServiceImpl implements CustColumnService{
	CustColumnDaoHibernate custColumnDao;
	ColumnDaoHibernate columnDao;
	
	@Override
	public List<Column> getByTable(String tablename) {
		// TODO Auto-generated method stub	
		List<Column> list=columnDao.getByTable(tablename.substring(5));		
		List<CustColumn> temp=custColumnDao.getByTable(tablename);
		for(CustColumn c : temp){
			list.add(c);
		}
		return list;
	}

	public void setCustColumnDao(CustColumnDaoHibernate custColumnDao) {
		this.custColumnDao = custColumnDao;
	}

	public void setColumnDao(ColumnDaoHibernate columnDao) {
		this.columnDao = columnDao;
	}

	@Override
	public void addColumn(CustColumn column) {
		// TODO Auto-generated method stub
		custColumnDao.addColumn(column);
	}
	
}
